<template>
	<div>
		<!-- 图片顶部 -->
		<div id="slider" class="mui-slider">
			<div id="sliderSegmentedControl" class="mui-scroll-wrapper mui-slider-indicator mui-segmented-control mui-segmented-control-inverted">
				<div class="mui-scroll">
					<a class="mui-control-item mui-active" href="#item1mobile" data-wid="tab-top-subpage-1.html">
						全部
					</a>
					<a class="mui-control-item" href="#item2mobile" data-wid="tab-top-subpage-2.html">
						风景
					</a>
					<a class="mui-control-item" href="#item3mobile" data-wid="tab-top-subpage-3.html">
						美女
					</a>
					<a class="mui-control-item" href="#item4mobile" data-wid="tab-top-subpage-4.html">
						科技
					</a>
					<a class="mui-control-item" href="#item5mobile" data-wid="tab-top-subpage-5.html">
						娱乐
					</a>
					<a class="mui-control-item" href="#item6mobile" data-wid="tab-top-subpage-6.html">
						动画
					</a>
				</div>
			</div>
		</div>
		<!-- 图片内容 -->
		<ul>
			<router-link v-for="item in list" :key='item.id' to='/home/photoinfo' tag="li">
				<img v-lazy="item.img1" width="100%" height="200px">
				<div class="info">
					<h1 class="info-title">图片标题</h1>
					<div class="info-body">图片内容</div>
				</div>
			</router-link>
		</ul>
	</div>
</template>


<script>
//1.导入mui的js文件
import mui from "../../lib/mui/js/mui.min.js";
//
export default {
  data() {
    return {
		id:'',
		img1:'',
		list:[
			{id:1,img1:require('../../images/l1.jpg')},
			{id:2,img1:require('../../images/l2.jpg')},
			{id:3,img1:require('../../images/l3.jpg')},
			{id:4,img1:require('../../images/l4.jpg')},
			{id:5,img1:require('../../images/l5.jpg')},
			{id:6,img1:require('../../images/l6.jpg')},
			{id:7,img1:require('../../images/l7.jpg')},
			{id:8,img1:require('../../images/l8.jpg')},
			{id:9,img1:require('../../images/l9.jpg')},
			{id:10,img1:require('../../images/l10.jpg')},
		]
	};
  },
  mounted() { 
    //当组件中的DOM结构被渲染并放到页面中后，会执行这个钩子函数
    //如果要操作元素了，最好在mounted里面，因为这里的元素是最新的
    //2.初始化
    mui(".mui-scroll-wrapper").scroll({
      deceleration: 0.0006 //flick 减速系数，系数越大，滚动速度越慢，滚动距离越小，默认值0.0006
    });
  }
};

</script>


<style lang="scss" scoped>
img[lazy=loading] {
  width: 40px;
  height: 300px;
  margin: auto;
}
li{
	margin-bottom: 10px;
	list-style: none;
	text-align: center;
	box-shadow: 0 0 9px #999;
	position: relative;
}
ul{
	padding: 10px;
}
.info{
	width: 100%;
	color: #ccc;
	text-align: left;
	position: absolute;
	bottom: 0;
	background-color: rgba(0, 0, 0, 0.4);
	max-height: 84px;
	.info-title{
		text-align: center;
		font-size: 14px;
	}
	.info-body{
		text-align: center;
		font-size: 13px;
	}
}
</style>


